import 'package:flutter/material.dart';

class Homenav extends StatefulWidget {
  const Homenav({super.key});

  @override
  State<Homenav> createState() => _HomenavState();
}

final List _NavList = [
  {"label": "我的房屋", "icon": "assets/images/house_nav_icon@2x.png"},
  {"label": "我的报修", "icon": "assets/images/repair_nav_icon@2x.png"},
  {"label": "访客登记", "icon": "assets/images/visitor_nav_icon@2x.png"},
];

class _HomenavState extends State<Homenav> {
  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      height: 50,
      color: Colors.white,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: [
          for (var item in _NavList)
            Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Image.asset(
                  item["icon"],
                  width: 30,
                  height: 30,
                ),
                Text(
                  item["label"],
                  style: const TextStyle(
                    fontSize: 12,
                    color: Colors.black,
                  ),
                ),
              ],
            ),
        ],
      ),
    );
  }
}
